package com.jt.mapper;

import com.jt.pojo.User;
import org.apache.ibatis.annotations.*;


import java.util.List;

@Mapper
public interface UserMapper {


    //查询demo_user表中的所有数据

    List<User> findAll();

    User findUserById(Integer id);

    User findUserByNA(@Param("name") String name, @Param("age") Integer age);


    List<User> findLike(String name);
    @Update("update demo_user set name=#{name},age=#{age} where id=#{id}")
    void update(User user) ;
    @Select("select * from demo_user where age=#{age} and sex=#{sex}")
    List<User> findUserByAS(User user);


    List<User> findUserByIds(Integer[] id);

    List<User> findUser(User user);

    @Select("select * from demo_user where name=#{name} and sex=#{sex}")
    List<User> findUserByNS(User user);

    @Insert("insert into demo_user values (null,#{name},#{age},#{sex})")
    void saveUser(User user);
    @Update("update demo_user set name=#{name},age=#{age},sex=#{sex} where id=#{id}")
    void updateUser(User user);
}
